<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>1.盒模型</title>
    <style>
        .box1{
            width: 100px;
            height: 100px;
            line-height: 100px;
            padding: 10px;
            border: 10px solid black;
            background: red;
            box-sizing: content-box;
            text-align: center;
            margin-bottom: 100px;
        }
        .box2{
            width: 100px;
            height: 100px;
            line-height: 100px;
            padding: 10px;
            border: 10px solid black;
            background: green;
            box-sizing: border-box;
            text-align: center;
        }
    </style>
</head>
<body>
    <div>
        <div>
            css盒模型主要包括以下两种方式，通过box-sizing属性进行配置
        </div>
        <div>
            <div>
                content-box: 默认属性，with只包含content
            </div>
            <div>
                border-box: with包括(content, padding, border)
            </div>
        </div>
        <div>
            <h5>例子:</h5>
            <div class="box1">
                box1
            </div>
            <div class="box2">
                box2
            </div>
        </div>
    </div>
</body>
</html>
